import request from "./index";

//获取全部评论
export interface getCommentAns {
    code: number;
    msg: string;
    data: Array<any>
}
export const getComment = () => {
    return request({
        url: '/action/getAll',
        method: 'get'
    })
}

// 发表评论
export interface subCommentAns {
    code: number;
    msg: string;
    data: any
}
export const subComment = (content: string,time: number) => {
    return request({
        url: '/action/submit',
        method: 'post',
        data: {
            content,
            time
        }
    })
}

// 用户点赞
export interface addLikeAns {
    code: number;
    msg: string;
    data: any
}
export const addLike = (aId: string) => {
    return request({
        url: '/action/like',
        method: 'get',
        params: {
            aId
        }
    })
}

//用户取消点赞
export interface disLikeAns {
    code: number;
    msg: string;
    data: any
}
export const disLike = (aId: string) => {
    return request({
        url: '/action/dislike',
        method: 'get',
        params: {
            aId
        }
    })
}